{% extends "view.html" %}

{% block table_head %}
    <th>magazine</th>
    <th>issue</th>
    <th>column</th>
    <th>feature title</th>
    <th></th>
{% endblock %}

{% block table_body %}

    {% for item in context['related'] %}
        {% set issue = item['issue'].get() %}
        <tr>
            <td><a href="{{ uri('magazines:view', key=issue.publication.urlsafe()) }}">{{ s.print_value(issue.publication) }}</a></td>
            <td><a href="{{ uri('issues:view', key=item['issue'].urlsafe()) }}">{{ s.print_value(issue.number_period_year()) }}</a></td>
            <td><a href="{{ uri('columns:view', key=item['column'].urlsafe()) }}">{{ s.print_value(item['column']) }}</a></td>
            <td>{{ s.print_value(item['description']) if item['description'] }}</td>
            <td class="text-right">
                {{ buttons.view_edit_delete_buttons(item, controller='features', target='feature') }}
            </td>
        </tr>
    {% endfor %}

{% endblock %}